package com.tek.ding.faceding.network;


import com.tek.ding.faceding.bean.AppVersion;
import com.tek.ding.faceding.bean.BaseBean;
import com.tek.ding.faceding.bean.Members;
import com.tek.ding.faceding.bean.Staff;
import com.tek.ding.faceding.bean.Store;
import com.tek.ding.faceding.utils.Config;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author byz
 * 网络请求类（一个接口一个方法）
 */
public interface HttpClient {

    class Builder {
        public static HttpClient getApiService() {
            return BuildFactory.getInstance().create(HttpClient.class, Config.BASE_URL);
        }

        public static HttpClient getWxService() {
            return BuildFactory.getInstance().create(HttpClient.class, Config.WX_URL);
        }
    }

    /**
     * 会员列表
     */
    @POST("app/members/v2/pageList")
    Observable<BaseBean<List<Members>>> getMemberList2(@Query("storeUid") String storeUid, @Query("page") int page, @Query("rows") int rows, @Query("fullName") String fullName);

    /**
     * 添加人脸数据
     */
    @POST("app/face/v2/addFaceEntity")
    Observable<BaseBean<String>> addFaceEntity2(@Query("storeUid") String storeUid, @Query("memberUid") String memberUid, @Query("faceImg") String faceImg);

    /**
     * 人脸签到
     */
    @POST("app/face/v2/toStoreFace")
    Observable<BaseBean<String>> toShopFace2(@Query("storeUid") String storeUid, @Query("faceImg") String faceImg);

    /**
     * 人脸签退
     */
    @POST("app/face/v2/leaveStoreFace")
    Observable<BaseBean<String>> leaveShopFace2(@Query("storeUid") String storeUid, @Query("faceImg") String faceImg);

    /**
     * 删除人脸样本
     */
    @POST("app/face/v2/deleteFaceEntity")
    Observable<BaseBean<String>> deleteFaceEntity2(@Query("storeUid") String storeUid, @Query("memberUid") String memberUid);

    /**
     * app通过人脸图片查找用户
     */
    @POST("app/face/v2/getMemberByFaceImg")
    Observable<BaseBean<Members>> getMemberByFaceImg2(@Query("storeUid") String storeUid, @Query("faceImg") String faceImg);

    /**
     * 添加会员读书记录
     */
    @POST("app/memberActionLog/v2/saveMemberReadBookLog")
    Observable<BaseBean<String>> saveMemberReadBookLog2(@Query("storeUid") String storeUid, @Query("memberUid") String memberUid, @Query("isbn") String isbn);

    /**
     * 登录
     */
    @POST("app/store/login")
    Observable<BaseBean<Staff>> login(@Query("storeUid") String storeUid, @Query("username") String username, @Query("password") String password);

    /**
     * 检查app版本更新
     */
    @POST("app/store/checkNewVersion")
    Observable<BaseBean<AppVersion>> checkNewVersionV2(@Query("storeUid") String storeUid, @Query("address") String address,
                                                       @Query("lng") String lng, @Query("lat") String lat);

    /**
     * 获取员工的所在门店
     */
    @POST("app/store/getStaffStores")
    Observable<BaseBean<List<Store>>> getStaffStores(@Query("storeUid") String storeUid, @Query("username") String username);

}